/**
 * Created by likai on 17/1/22.
 */
const Person = require("./ES6_Class");

class Student extends Person {
    constructor (name, age, sex) {
        super (name, age)
        this.sex = sex
    }
    print() {
        // var info = this.getInfo()
        var info = super.getInfo() // 可以通过super访问父类原型上的方法，但不能访问父类的属性
        var name = super.name // err
        super.neme = 'ok'
        console.log(super.name)
        console.log(info)
        console.log(name)
    }
}
var student = new Student("Lear","30","male");

student.print()

console.log(student instanceof  Student); //true
console.log(Student.prototype);// Student {}

console.log(student.__proto__=== Student.prototype);

console.log(Student.__proto__ === Person.prototype.constructor);//true

console.log(Student.__proto__ ==Person);//true


